﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ServiceMaster.aspx.cs" Inherits="Main_Inventory_ServiceMaster" Culture="en-GB" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Service Master </title>
    <link rel="Stylesheet" href="../../Styles/accounts.css" type="text/css" /> 
</head>
<body>
    <form id="form1" runat="server">
    <acc:heading ID="pagehead" runat="server" HeadingText="Service Master" />
    <Ajax:ToolkitScriptManager ID="scm" runat="server" EnablePartialRendering="true">
    </Ajax:ToolkitScriptManager>
    <div class="divmain" style="margin-left: 15%; margin-right: 15%; width: 70%;">
      <asp:Panel ID="PnlAddNew" runat="server" Visible="false">
       <%-- <asp:UpdatePanel ID="Updatepanel" runat="server">
            <ContentTemplate>--%>
                <asp:Label ID="lblMsg" runat="server" Font-Bold="true"></asp:Label>
                <table class="tablecontent" style="width: 100%; margin-top: 2%">
                    <tr>
                        <td class="headtd" colspan="4">
                            Service Master
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Service Name <span class="required">*</span>
                        </td>
                        <td>
                            <asp:TextBox ID="TxtServiceName" runat="server" ValidationGroup="V"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RfvTxtServiceName" runat="server" ValidationGroup="V"
                                ControlToValidate="TxtServiceName" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </td>
                        <td>
                            Head of Account <span class="required">*</span>
                        </td>
                        <td>
                            <asp:DropDownList ID="DdlHeadofAccount" runat="server" CssClass="dropdown" ValidationGroup="V">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RfvDdlHeadofAccount" runat="server" InitialValue="0"
                                ValidationGroup="V" ControlToValidate="DdlHeadofAccount" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Taxablity <span class="required">*</span>
                        </td>
                        <td>
                            <asp:DropDownList ID="DdlTaxablity" runat="server" CssClass="dropdown" ValidationGroup="V" AutoPostBack="true"
                                OnSelectedIndexChanged="DdlTaxablity_SelectedIndexChanged">
                            </asp:DropDownList>
                        </td>
                        <td>
                            Category
                        </td>
                        <td>
                            <asp:DropDownList ID="DdlCategory" CssClass="dropdown" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4"  style="padding:0;">
                            <asp:Panel ID="PanelTaxablity" runat="server" Visible="false">
                                <table>
                                    <tr>
                                        <td align="left" style="width:100px;" >
                                            SubClass
                                        </td>
                                        <td align="right">
                                            <asp:DropDownList ID="DdlSubclass" CssClass="dropdown" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlSubclass_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </td>
                                       
                                    </tr>
                                </table>
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:Panel ID="PanelExpense" runat="server" Visible="false">
                                <table>
                                    <tr>
                                        <td>
                                            Expense Reimbursement
                                        </td>
                                        <td>
                                            <asp:RadioButtonList ID="Radioexpense" runat="server" RepeatDirection="Horizontal">
                                                <asp:ListItem Text="Include in Bill" Value="0" Selected="True"></asp:ListItem>
                                                <asp:ListItem Text="Include in Debit Note" Value="1"></asp:ListItem>
                                            </asp:RadioButtonList>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Service Charge %
                        </td>
                        <td>
                            <asp:TextBox ID="TxtService" Width="40%" runat="server" CssClass="inputnumber" Text="0.00" 
                                ValidationGroup="V" Height="18px"></asp:TextBox>
                            <asp:RangeValidator ID="RangevalService" runat="server" 
                                ControlToValidate="TxtService" Display="Dynamic" ValidationGroup="V"  Type="Double"
                                ErrorMessage="*" MaximumValue="99" MinimumValue="0"></asp:RangeValidator>
                        </td>
                        <td>
                            Additional Description
                        </td>
                        <td>
                            <asp:TextBox ID="TxtAdditionDescription" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                </table>
                <table class="tablecontent" style="width: 100%; margin-top: 2%">
                    <tr>
                        <td colspan="2" class="headtd">
                            Tax Details
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Service Tax Classification&nbsp;&nbsp;
                            <asp:HiddenField ID="hidServiceId" runat="server" /> 
                            <asp:Button ID="btnService" runat="server" Text="..." OnClientClick="return service();" />
                            <span class="required">*</span>
                        </td>
                        <td>
                            <asp:TextBox ID="TxtServicetax" Enabled="true" Width="400px" runat="server" ValidationGroup="V"
                                CssClass="input">
                            </asp:TextBox>
                            <asp:RequiredFieldValidator ID="RFVTxtServicetax" runat="server" 
                                ValidationGroup="V" ControlToValidate="TxtServicetax" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                </table>
                <table class="tablecontent" style="width: 100%; margin-top: 1%">
                    <tr>
                        <td style="width: 17%">
                            Service tax
                        </td>
                        <td style="width: 17%">
                            Tax Rate(%)<asp:TextBox ID="TxtRate" Enabled="false" runat="server" Width="50px"
                                CssClass="inputnumber"></asp:TextBox>
                        </td>
                        <td style="width: 15%">
                            PE Cess(%)
                        </td>
                        <td style="width: 15%">
                            <asp:TextBox ID="TxtPeCess" runat="server" Enabled="false" Width="50px" CssClass="inputnumber"></asp:TextBox>
                        </td>
                        <td style="width: 18%">
                            HE Cess(%)
                        </td>
                        <td style="width: 18%">
                            <asp:TextBox ID="TxtHecess" runat="server" Enabled="false" Width="50px" CssClass="inputnumber"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Additional Tax
                        </td>
                        <td>
                            <asp:DropDownList ID="DdlAdditionTax" Enabled="false" runat="server" CssClass="dropdown"
                                AutoPostBack="true" OnSelectedIndexChanged="DdlAdditionTax_SelectedIndexChanged">
                            </asp:DropDownList>
                        </td>
                        <td>
                            Tax Rate(%)
                        </td>
                        <td>
                            <asp:TextBox ID="TxtTaxRate" runat="server" Enabled="false" Width="50px" CssClass="inputnumber"></asp:TextBox>
                        </td>
                         <td colspan="2">
                            <asp:Panel ID="PanelExempted" runat="server" Visible="false">
                                Tax Exempted(%)&nbsp;
                                <asp:TextBox ID="TxtExempted" runat="server" Width="50px" CssClass="inputnumber"></asp:TextBox>
                                 <asp:RangeValidator ID="RangeValidator1" runat="server" 
                                ControlToValidate="TxtExempted" Display="Dynamic" ValidationGroup="V"  Type="Double"
                                ErrorMessage="*" MaximumValue="99" MinimumValue="0"></asp:RangeValidator>
                            </asp:Panel>
                         </td>
                        
                    </tr>
                </table>
                <asp:Panel ID="PanelTax" runat="server" Enabled="true">
                    <table class="tablecontent" style="width: 100%; margin-top: 2%">
                        <tr>
                            <td class="headtd">
                                Apply Tax Conditions
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:RadioButtonList ID="RadioApplyTax" runat="server">
                                    <asp:ListItem Text="Service Tax & Additional Tax on Taxable Amount" Value="0" Selected="True"></asp:ListItem>
                                    <asp:ListItem Text="Service Tax & (Taxable Amount + Additional Tax Amount)" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="Additional Tax on (Taxable Amount + Service tax Amount)" Value="2"></asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <div style="width: 40%; margin-left: 30%; margin-left: 30%;">
                    <table>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td align="right">
                                <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="button" ValidationGroup="V"
                                    OnClick="btnSubmit_Click" />
                                &nbsp;
                                <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="button" 
                                    onclick="btnCancel_Click"  />
                            </td>
                        </tr>
                    </table>
                </div>
           <%--   </ContentTemplate>
        </asp:UpdatePanel>--%>
      </asp:Panel>
   </div>      
         <asp:Panel ID="PnlView" runat="server" Visible="false">
                 <div style=" width:90%; margin-left:5%; margin-right:5%;">
                    <asp:GridView ID="GrdService" Width="100%" runat="server" 
                         AutoGenerateColumns="false" CssClass="gridview"
                        PageSize="15" AllowPaging="true" EmptyDataText="No Record Exist!" AlternatingRowStyle-CssClass="gridview_alternate"
                        PagerStyle-CssClass="pgr" EmptyDataRowStyle-CssClass="emptyrow" RowStyle-CssClass="gridviewitem"
                        DataKeyNames="SERVICEID" 
                         onselectedindexchanged="GrdService_SelectedIndexChanged" onpageindexchanging="GrdService_PageIndexChanging" 
                         
                        >
                        <Columns>
                            <asp:TemplateField HeaderText="Sr No.">
                                <ItemTemplate>
                                    <%#Container.DataItemIndex+1 %>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="Service Name" DataField="SERVICENAME" />
                            <asp:BoundField HeaderText="Head of Account" DataField="LNAME" />
                            <asp:BoundField HeaderText="Service Tax Classifications" DataField="serviceclassification" />
                            <asp:CommandField HeaderText="Edit" SelectText="<img src='../../Menu/images/Edit_user.png'/>"
                                ShowHeader="True" ShowSelectButton="True" ItemStyle-HorizontalAlign="Center" />
                        </Columns>
                    </asp:GridView>
                </div>
        </asp:Panel>
            
    
        <script src="../../JavaScript/Commons.js" type="text/javascript"></script>

        <script language="javascript" type="text/javascript">
            function service() {
                var serviceId = document.getElementById("hidServiceId").value;
                window.open("ServiceClassification.aspx?Txtbox=TxtServicetax&hidenvalue=hidServiceId&ServiceId=" + serviceId + "", "MyWindow", 'width=800,height=500, toolbar=no, menubar=no, addressbar=no,resizable=yes, scrollbars=yes');
                return false;
            }
        </script>    
    </form>
</body>
</html>
